/**
 * Highlight.java
 *
 * Roslan's Remake of MOO in 3D using Ardor3D
 * (C) 2010-2012 Roslan Amir. All rights reserved.
 */

package name.roslan.games.moo3d.spatial;

import com.ardor3d.image.Texture;
import com.ardor3d.image.TextureStoreFormat;
import com.ardor3d.math.type.ReadOnlyColorRGBA;
import com.ardor3d.renderer.state.MaterialState;
import com.ardor3d.renderer.state.TextureState;
import com.ardor3d.scenegraph.Node;
import com.ardor3d.scenegraph.shape.Disk;
import com.ardor3d.util.TextureManager;

/**
 * This class represents the node for highlighting the selected star or colony or fleet.
 * 
 * @author Roslan Amir
 * @version 1.0 - Aug 16, 2011
 */
public class Highlight extends Node {

	/**
	 * The billboard background image
	 */
	private static final String HIGHLIGHT_IMAGE = "images/highlight.png";

	/**
	 * The billboard background texture
	 */
	private static final Texture HIGHLIGHT_TEXTURE = TextureManager.load(HIGHLIGHT_IMAGE, Texture.MinificationFilter.Trilinear, TextureStoreFormat.GuessCompressedFormat, true);

	/**
	 * Constructor.
	 * 
	 * @param name
	 * @param radius
	 * @param emissiveColor
	 */
	protected Highlight(String name, double radius, ReadOnlyColorRGBA emissiveColor) {
		super(name + "Node");

		final Disk disk = new Disk(name + "Disk", 64, 64, radius);
		this.attachChild(disk);

		final TextureState ts = new TextureState();
		ts.setEnabled(true);
		ts.setTexture(HIGHLIGHT_TEXTURE);
		this.setRenderState(ts);

		final MaterialState ms = new MaterialState();
		ms.setEnabled(true);
		ms.setEmissive(emissiveColor);
		this.setRenderState(ms);
	}

}
